﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace FrameWork.UI.UserControls
{
    /// <summary>
    /// MyDateTimePicker.xaml 的交互逻辑
    /// </summary>
    public partial class MyDateTimePicker : UserControl
    {
        public MyDateTimePicker()
        {
            InitializeComponent();
        }


        


        public DateTime? SelectDateTime { get; set; }
        
 
  



        private void iconbutton1_Click(object sender, RoutedEventArgs e)
        {
           
            TDateTimeView dtView = new TDateTimeView(textBlock1.Text);// TDateTimeView  构造函数传入日期时间
            dtView.DateTimeOK += (dateTimeStr) =>
            {
                if (popUpchoice.IsOpen)
                {
                    popUpchoice.IsOpen = false;
                }
                textBlock1.Text = dateTimeStr.ToString();
                SelectDateTime = Convert.ToDateTime(dateTimeStr);
            };
            popUpchoice.Child = dtView;
            popUpchoice.IsOpen = true;
        }
    }
}
